﻿namespace MF.HSD.StdUnitCostBP
{
	using System;
	using System.Collections.Generic;
	using System.Text;
    using UFIDA.U9.CA.DateData;
    using UFSoft.UBF.AopFrame;	
	using UFSoft.UBF.Util.Context;

	/// <summary>
	/// GetOutPutQtyItemList partial 
	/// </summary>	
	public partial class GetOutPutQtyItemList 
	{	
		internal BaseStrategy Select()
		{
			return new GetOutPutQtyItemListImpementStrategy();	
		}		
	}
	
	#region  implement strategy	
	/// <summary>
	/// Impement Implement
	/// 
	/// </summary>	
	internal partial class GetOutPutQtyItemListImpementStrategy : BaseStrategy
	{
		public GetOutPutQtyItemListImpementStrategy() { }

		public override object Do(object obj)
		{						
			GetOutPutQtyItemList bpObj = (GetOutPutQtyItemList)obj;

			OutputQty.EntityList outputQtyList = OutputQty.Finder.FindAll("CostField.Code='"+ bpObj.CostField + "' and Org.Code='" + bpObj.OrgCode + "' and AccountingPeriod.DisplayName='" + bpObj.DisPlayName + "'");

			List<string> list = new List<string>();
			if(outputQtyList!= null  && outputQtyList.Count > 0)
            {
				foreach (OutputQty dto in outputQtyList)
					list.Add(dto.ItemMaster.ID.ToString());
			}
            else
            {
				throw new Exception("当前期间，成本域获取不到料品数据！");
            }
			return list;


		}		
	}

	#endregion
	
	
}